<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <input id="input" type="text" style="color: red; font-size: 40px" />
    <script>
      // 同步
      const input = document.getElementById("input");
      setTimeout(() => {
        console.log(input.getAttribute("style"));
        console.log(input.style.color);
        console.log(input.style.fontSize);
        console.log(input.style["font-size"]);
      }, 3000);
    </script>
  </body>
</html>
